/**
 * Copyright &copy; 2012-2016 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
 */
package com.thinkgem.jeesite.modules.devmng.service;

import java.util.List;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.thinkgem.jeesite.common.service.TreeService;
import com.thinkgem.jeesite.common.utils.StringUtils;
import com.thinkgem.jeesite.modules.devmng.entity.DeviceType;
import com.thinkgem.jeesite.modules.devmng.dao.DeviceTypeDao;

/**
 * 类型Service
 * @author panda
 * @version 2017-12-02
 */
@Service
@Transactional(readOnly = true)
public class DeviceTypeService extends TreeService<DeviceTypeDao, DeviceType> {

	public DeviceType get(String id) {
		return super.get(id);
	}
	
	public List<DeviceType> findList(DeviceType deviceType) {
		if (StringUtils.isNotBlank(deviceType.getParentIds())){
			deviceType.setParentIds(","+deviceType.getParentIds()+",");
		}
		return super.findList(deviceType);
	}
	
	@Transactional(readOnly = false)
	public void save(DeviceType deviceType) {
		super.save(deviceType);
	}
	
	@Transactional(readOnly = false)
	public void delete(DeviceType deviceType) {
		super.delete(deviceType);
	}
	
}